//
// Created by 邹嘉旭 on 2025/8/5.
//

#ifndef AMM_H
#define AMM_H

#include <stdatomic.h>
#include <ld_bitset.h>

#include "ldacs_corenet.h"
#include "elements/elements.h"
#include "interface/ground.h"

#include "util/log.h"


extern struct_desc_t test_msg_desc;

#define TO_SAC(src) ((src) + 200)
#define FROM_SAC(src) ((src) - 200)

#define MAX_SAC (4096-200)
typedef struct amm_entity_s{
    ld_bitset_t *sac_bitset; // 从200开始分配，需要(4096-200) / 8 共487字节
}amm_entity_t;

amm_entity_t *init_amm_entity();

void free_amm_entity(amm_entity_t *entity);

l_err start_amm(net_element_t *net_element);

l_err stop_amm(net_element_t *net_ele);

#endif //AMM_H
